1. Field of the Invention
This invention relates to an information processing system in which instructions stored in a memory are successively read out to execute instructed processing and, more particularly, to an information processing system for executing a plurality of programs virtually in parallel.
2. Description of the Prior Art
A plurality of programs can be executed with one CPU in a virtually parallel manner by changing the CPU at certain time intervals (not always constant) to successively execute the programs little by little. Determining the procedure of changing the CPU for this purpose is called scheduling, and a program for scheduling the CPU is called a monitor. There are conventional CPU scheduling methods:
a) one in which programs are executed in order of arrival of execution requests at the monitor irrespective of the kind and size of the programs, and in which the CPU is not changed over until one program is completed (FCFS method);
b) one in which if during execution of a program the monitor receives a request for execution of another program which can be executed in a shorter length of time in comparison with the program presently being executed, the program of the shorter execution time being executed immediately (SPT method); and
c) one in which the CPU is assigned to each program for a predetermined constant length of time (quantum) irrespective of the size and the kind of the programs, and in which if the processing of one program is not completed in one quantum, it is suspended to be started again in the next cycle of the program rotation and the CPU is assigned to the next program (RR method).
The FCFS method entails a drawback such that when a program having a long processing time is executed, services to other programs are insufficient. In the case of the SPT method, it is difficult to previously know the processing time for each program, and the load on the monitor is increased by the operation of detecting the processing time. In the case of the RR method, the same problem as that of the FCFS method is encountered with respect to a long-processing-time program, if the quantum is excessively long. If the quantum is short, the CPU is frequently changed over and the overhead of the monitor is large. It is therefore necessary to optimize the quantum by considering these conditions, but it is difficult to determine an optimal quantum.